<?php

class csHtmlHead {
    public $base_href;
    public $charset;
    public $title;
    public $keywords;
    public $description;
    public $robots;
    public $css_tbl;
    public $js_tbl;

    public function __construct($params = null) {
        //TODO - pobrac konfiguracje, nie tak na sztywo
        $this -> base_href = 'http://'.$_SERVER["SERVER_NAME"].(dirname($_SERVER["SCRIPT_NAME"]) == '/' ? '/' : dirname($_SERVER["SCRIPT_NAME"]).'/');
        $this -> charset = 'utf-8';

        $this -> title = null;
        $this -> keywords = null;
        $this -> description = null;
        $this -> robots = null;
        $this -> css_tbl = array();
        $this -> js_tbl = array();
    }

    public function set_header($pgid = null) {
		$tvarr = array(
            'charset',
            'base_href',
            'title',
            'keywords',
            'description',
            'robots',
            'css_tbl',
            'js_tbl'
        );

        foreach($tvarr as $tvind => $tvname) {
            $GLOBALS['tpl_system'] -> tpl_vars[$tvname] = $this -> $tvname;
        }
    }
}

?>
